package com.example.common.utils;

import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * @Author wxy
 * @Date 2021/1/19 16:56
 * @Version 1.0
 */
@Component
public class UIDUtils {
    @Resource
    private HttpServletRequest request;

    /**
     * 获取当前登陆者UID
     */
    public Long getUid() {
        return Long.valueOf(request.getHeader("UID"));
    }
}
